@extends('layouts.default')
@section('content')
    <div class="row">
        <div class="col-md-12">
            <!-- general form elements -->
            <div class="card card-primary">
                <div class="card-header">
                    <h3 class="card-title">更新系统配置</h3>
                </div>
            @include('layouts.error')
            <!-- /.card-header -->
                <!-- form start -->

                    <form role="form" method="post" enctype="multipart/form-data" action="{{url('admin/system/aboutus_update',[$list->id])}}">
                        {{ csrf_field() }}
                        <div class="card-body">
                            <div class="form-group">
                                <label for="banner-title">公司名称</label>
                                <input type="text" name="name" class="form-control" id="banner-title" placeholder="请输入轮播标题" value="{{old('name',$list->name)}}">
                            </div>
                            <div class="form-group">
                                <label for="banner-url">版权编辑</label>
                                <input type="text" name="copyright" class="form-control" id="banner-url" placeholder="请输入版权信息" value="{{old('copyright',$list->copyright)}}">
                            </div>
                            <div class="form-group">
                                <label for="banner-image">公司logo</label><br>
                                <label for="file" class='btn btn-success col-md-2'>
                                    <input type="file" name="image" id="file" class="inputfile" onchange="changepic(this)" style="opacity: 0;width: 5%" />
                                    选择图片</label>
                                <img src="{{$list->image}}" id="show" width="200">
                            </div>

                        </div>
                        <!-- /.card-body -->

                        <div class="card-footer" >
                            <button type="submit" class="btn btn-primary " style="float: right">Submit</button>
                        </div>
                    </form>
            </div>
            <!-- /.card -->
        </div>
    </div>
@stop
@section('script')
    <script src="{{asset('admin-lte/plugins/jquery/jquery.min.js')}}"></script>
    <script>
        function changepic() {
            var reads= new FileReader();
            f=document.getElementById('file').files[0];
            reads.readAsDataURL(f);
            reads.onload=function (e) {
                document.getElementById('show').src=this.result;
            };
        }
    </script>
@stop